//
//  XmlLogger.m
//  Do Not Disturb
//
//  Created by Chris Karr on 9/15/07.
//  Copyright 2007 __MyCompanyName__. All rights reserved.
//

#import "XmlLogger.h"


@implementation XmlLogger

- (void) logLabel:(NSString *) label readings:(NSArray *) readings
{
//	[super logLabel:label readings:readings];

	NSMutableData * data = [NSMutableData data];

	NSKeyedArchiver * archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData:data];
	[archiver setOutputFormat:NSPropertyListXMLFormat_v1_0];

	[archiver encodeObject:label forKey:@"DNDLabel"];
	[archiver encodeObject:readings forKey:@"DNDReadings"];

	[archiver finishEncoding];

	[data writeToFile:[NSString stringWithFormat:@"%@/Desktop/logs/%f.xml", NSHomeDirectory (), 
		[[NSDate date] timeIntervalSinceReferenceDate]] atomically:YES];

	[archiver release];
}	


@end
